{include file="public/header" /}
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>设备管理</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
  <div class="fixed-empty"></div>

  <form method="get" name="formSearch" id="formSearch">
      <div class="ds-search-form">
            <dl>
                <dt>设备名称：</dt>
                <dd><input type="text" value="{$Request.get.search_goods_name|default=''}" name="search_goods_name" id="search_goods_name" class="txt"></dd>
            </dl>
          <dl>
              <dt>商品品牌：</dt>
              <dd>
                  <div id="ajax_brand" class="dssc-brand-select w180">
                      <div class="selection">
                          <input name="b_name" id="b_name" value="{$Request.param.b_name|default=''}" type="text" class="txt w180" readonly="readonly" />
                          <input type="hidden" name="b_id" id="b_id" value="{$Request.param.b_id|default=''}" />
                      </div>
                      <div class="dssc-brand-select-container">
                          <div class="brand-index"  data-url="{:url('Common/ajax_get_brand')}">
                              <div class="letter" dstype="letter">
                                  <ul>
                                      <li style="width: auto;"><a href="javascript:void(0);" data-letter="all">所有品牌</a></li>
                                      <li style="width: auto;"><a href="javascript:void(0);" data-letter="A">A</a></li>
                                      <li><a href="javascript:void(0);" data-letter="B">B</a></li>
                                      <li><a href="javascript:void(0);" data-letter="C">C</a></li>
                                      <li><a href="javascript:void(0);" data-letter="D">D</a></li>
                                      <li><a href="javascript:void(0);" data-letter="E">E</a></li>
                                      <li><a href="javascript:void(0);" data-letter="F">F</a></li>
                                      <li><a href="javascript:void(0);" data-letter="G">G</a></li>
                                      <li><a href="javascript:void(0);" data-letter="H">H</a></li>
                                      <li><a href="javascript:void(0);" data-letter="I">I</a></li>
                                      <li><a href="javascript:void(0);" data-letter="J">J</a></li>
                                      <li><a href="javascript:void(0);" data-letter="K">K</a></li>
                                      <li><a href="javascript:void(0);" data-letter="L">L</a></li>
                                      <li><a href="javascript:void(0);" data-letter="M">M</a></li>
                                      <li><a href="javascript:void(0);" data-letter="N">N</a></li>
                                      <li><a href="javascript:void(0);" data-letter="O">O</a></li>
                                      <li><a href="javascript:void(0);" data-letter="P">P</a></li>
                                      <li><a href="javascript:void(0);" data-letter="Q">Q</a></li>
                                      <li><a href="javascript:void(0);" data-letter="R">R</a></li>
                                      <li><a href="javascript:void(0);" data-letter="S">S</a></li>
                                      <li><a href="javascript:void(0);" data-letter="T">T</a></li>
                                      <li><a href="javascript:void(0);" data-letter="U">U</a></li>
                                      <li><a href="javascript:void(0);" data-letter="V">V</a></li>
                                      <li><a href="javascript:void(0);" data-letter="W">W</a></li>
                                      <li><a href="javascript:void(0);" data-letter="X">X</a></li>
                                      <li><a href="javascript:void(0);" data-letter="Y">Y</a></li>
                                      <li><a href="javascript:void(0);" data-letter="Z">Z</a></li>
                                      <li><a href="javascript:void(0);" data-letter="0-9">其他</a></li>
                                  </ul>
                              </div>
                              <div class="search" dstype="search"><input name="search_brand_keyword" id="search_brand_keyword" type="text" class="text" /><a href="javascript:void(0);" class="dssc-btn-mini" style="vertical-align: top;">Go</a></div>
                          </div>
                          <div class="brand-list" dstype="brandList">
                              <ul dstype="brand_list">
                                  {notempty name="brand_list"}
                                  {foreach name="brand_list" item="val"}
                                  <li data-id='{$val.brand_id}'data-name='{$val.brand_name}'><em>{$val.brand_initial}</em>{$val.brand_name}</li>
                                  {/foreach}
                                  {/notempty}
                              </ul>
                          </div>
                          <div class="no-result" dstype="noBrandList" style="display: none;">{$Think.lang.no_brand_result}</div>
                      </div>
                  </div>
              </dd>
          </dl>
            <div class="btn_group">
                <input type="hidden" name="type" value="{$Request.param.type}">
                 <a href="javascript:void(0);" id="dssubmit" class="btn " title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>     
                 {if $search_goods_name != '' ||  $b_id != ''}
                 <a href="{:url('Addbricks/index',['type'=>$Request.param.type])}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                  {/if}
            </div>
        </div>
  </form>
  
      
    <table class="ds-default-table">
        <thead>
        <tr class="thead">
            <th class="w48">序号</th>
            <th>设备名称</th>
            <th>分类&品牌</th>
            <th>规格</th>
            <th>型号</th>
            <th>上下架</th>
            <th>审核状态</th>
            <th class="w200 align-center">创建时间</th>
            <th class="w200 align-center">{$Think.lang.ds_handle}</th>
        </tr>
        <tbody>
        {notempty name="bricks_list"}
        {foreach name="bricks_list" item="question" key="key"}
        <tr id="ds_row_{$question.bricks_id}">
            <td>{$key+1}</td>
            <td>{$question.equipment_name}</td>
            <td>
                <p>{$question.gc_name}</p>
                <p class="goods-brand">{$Think.lang.ds_brand}：{$question.b_name}</p>
            </td>
            <td>{$question.bricks_spec}</td>
            <td>{$question.bricks_type}</td>
            <td>
                {if $question.status == 1}
                   上架
                {else/}   
                   下架
                {/if}
            </td>
            <td>{$enterprise_status[$question['bricks_status']]}</td>
            <td>{$question.create_time|date="Y-m-d H:i:s",###}</td>
            <td>
                    {if $question.bricks_status == 0}
                       <a href="javascript:void(0);" onclick="goods_verify({$question.bricks_id})" class="dsui-btn-edit"><i class="iconfont"></i>审核</a>
                    {/if}
                    {if $question.bricks_status != 0}
                       <a href="javascript:void(0);" onclick="goods_content({$question.bricks_id})" class="dsui-btn-view"><i class="iconfont"></i>查看</a>
                    {/if}   

                    {if $question.status == 1}
                    <a href="javascript:void(0);"
                       onclick="ds_ajaxget_confirm('{:url('Addbricks/equipment_status',['bricks_id'=>$question.bricks_id,'status'=>$question.status])}','确定要下架吗？');"
                       class="dsui-btn-del">下架</a>
                    {else/}   
                    <a href="javascript:void(0);"
                       onclick="ds_ajaxget_confirm('{:url('Addbricks/equipment_status',['bricks_id'=>$question.bricks_id,'status'=>$question.status])}','确定要上架吗？');"
                       class="dsui-btn-edit">上架</a>
                    {/if}

                    <!-- <a href="{:url('Equipment/equipment_edit',['bricks_id'=>$question.bricks_id])}" class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_edit}</a> -->

                    <a href="javascript:void(0);"
                       onclick="ds_ajaxget_confirm('{:url('Addbricks/bricks_del',['bricks_id'=>$question.bricks_id])}','确定要删除吗？');"
                       class="dsui-btn-del"><i class="iconfont"></i>删除</a>
            </td>
        </tr>
        {/foreach}
        {else /}
        <tr class="no_data">
            <td colspan="10">{$Think.lang.ds_no_record}</td>
        </tr>
        {/notempty}
        </thead>
    </table>
    {$show_page}
    
</div>
<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.mousewheel.js"></script>
<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js" charset="utf-8"></script>

<script type="text/javascript">
var HOMESITEURL = "{$Think.HOME_SITE_URL}";
/* AJAX选择品牌 */
$("#ajax_brand").brandinit();

$('#dssubmit').click(function(){
    $('#formSearch').submit();
});

    $('#dssubmit').click(function(){
        $('#formSearch').submit();
    });

    // 审核
    function goods_verify(ids_str) {
        _uri = ADMINSITEURL+"/Addbricks/goods_verify?bricks_id=" + ids_str;
        dsLayerOpen(_uri,'审核','1000px','700px');
    }

     // 详情查看
    function goods_content(ids_str) {
        _uri = ADMINSITEURL+"/Addbricks/goods_content?bricks_id=" + ids_str;
        dsLayerOpen(_uri,'详情','1000px','700px');
    }




</script>





{include file="public/footer" /}